Skip to content

Add Rake task to validate complete recurring configuration#740

Closed
J-Verz wants to merge 4 commits into
rails:mainfrom
J-Verz:validate-recurring-config
Closed

Add Rake task to validate complete recurring configuration#740
J-Verz wants to merge 4 commits into
rails:mainfrom
J-Verz:validate-recurring-config

Conversation

@J-Verz

@J-Verz J-Verz commented Apr 20, 2026

Copy link
Copy Markdown

This PR is my attempt at a solution for the problems described in #722. It adds a Rake task validate_recurring_config which loads the recurring task configuration (not only for the current RAILS_ENV) and asserts whether every task definition is valid. If any task is invalid, it exits with a non-zero code and prints the validation errors to stdout. If all tasks are valid, it prints 'All recurring tasks are valid' and exits with code 0.

One problem it still has is that it only works for configurations split by Rails environment; if you define tasks in the top-level (like recurring_with_invalid.yml in the dummy app), you get an exception. I'm open for suggestions how to fix that.

There are also no tests yet, let me know if you would like me to add those.

@rosa

rosa commented Jul 20, 2026

Copy link
Copy Markdown
Member

Hey @J-Verz! Thanks a lot for this! In the end, I ended up merging #745, which validates the whole config and not just recurring tasks. I'm closing this one then, but thanks a lot for contributing! 🙏🏻

@rosa rosa closed this Jul 20, 2026
@J-Verz
J-Verz deleted the validate-recurring-config branch July 20, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants